package com.wangxiaoxuan.seckill.controller;

import com.wangxiaoxuan.seckill.pojo.User;
import com.wangxiaoxuan.seckill.service.CaptchaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 王小轩
 * @version 1.0
 * @date 2022年08月23日 15:20
 */
@RestController
@RequestMapping("/captcha")
public class CaptchaController {
    @Autowired
    private CaptchaService captchaService;

    /**
     * 获取验证码
     * @param user
     * @param goodsId
     * @param response
     */
    @RequestMapping("/getCaptcha")
    public void getCaptcha(User user, Long goodsId, HttpServletResponse response){
        captchaService.getCaptcha(user,goodsId,response);
    }

}
